<!-- $Id -->
<!DOCTYPE html>
<html>
<head>
{include file='html_header.htm'}
</head>
{include file='page_header.htm'}
<body>
<form name="theForm" method="get" action="order.php" onsubmit="return check()">
  <div class="order_info_con">
    <div class="list-div order_operate">
      <table width="100%" cellpadding="3" cellspacing="1">
        <tr>
          <td width="30%"><span>{$lang.label_action_note}</span></td>
          <td><textarea name="action_note" cols="60" rows="3">{$action_note}</textarea>
            {if $require_note}{$lang.require_field}{/if}</td>
        </tr>
        {if $show_cancel_note}
        <tr>
          <td><span>{$lang.label_cancel_note}</span></td>
          <td><textarea name="cancel_note" cols="60" rows="3" id="cancel_note">{$cancel_note}</textarea>{$lang.require_field}<br><span>{$lang.notice_cancel_note}</span></td>
        </tr>
        {/if}
        {if $show_invoice_no}
        <tr>
          <td><span>{$lang.label_invoice_no}</span></td>
          <td><input name="invoice_no" type="text" size="30" /></td>
        </tr>
        {/if}
        {if $show_refund}
        <tr>
          <td><span>{$lang.label_handle_refund}</span></td>
          <td><p>{if !$anonymous}
              <label>
                <input type="radio" name="refund" value="1" class="input_radio no-ml"/>
                {$lang.return_user_money}</label>
              <br>
              {/if}
              <label>
                <input type="radio" name="refund" value="2" class="input_radio no-ml"/>
                {$lang.create_user_account}</label>
              <br>
              <label>
                <input name="refund" type="radio" value="3" class="input_radio no-ml"/>
                {$lang.not_handle}</label>
              <br>
            </p></td>
        </tr>
        <tr>
          <td><span>{$lang.label_refund_note}</span></td>
          <td><textarea name="refund_note" cols="60" rows="3" id="refund_note">{$refund_note}</textarea></td>
        </tr>
        {/if}
      </table>
    </div>
    <p class="order_btn_p">
        <span>
            <input type="submit" name="submit" value="{$lang.button_submit}" s/></span>
        <span> <input type="button" name="back" value="{$lang.back}" onclick="history.back()" /></span>
          <input type="hidden" name="order_id" value="{$order_id}" />
          <input type="hidden" name="operation" value="{$operation}" />
          <input type="hidden" name="act" value="{if $batch}batch_operate_post{else}operate_post{/if}" />
	</p>
  </div>
</form>
<script language="JavaScript">
  var require_note = '{$require_note}';
  var show_refund  = '{$show_refund}';
  var show_cancel = '{$show_cancel_note}';
{literal}
  function check()
  {
    if (require_note && document.forms['theForm'].elements['action_note'].value == '')
    {
      alert(pls_input_note);
      return false;
    }
	if (show_cancel && document.forms['theForm'].elements['cancel_note'].value == '')
	{
	  alert(pls_input_cancel);
	  return false;
	}
    if (show_refund)
    {
      var selected = false;
      for (var i = 0; i < document.forms['theForm'].elements.length; i++)
      {
        ele = document.forms['theForm'].elements[i];
        if (ele.tagName == 'INPUT' && ele.name == 'refund' && ele.checked)
        {
          selected = true;
          break;
        }
      }
      if (!selected)
      {
        alert(pls_select_refund);
        return false;
      }
    }
    return true;
  }
{/literal}
</script> 
{include file='page_footer.htm'}
</body>
</html>